﻿<Window x:Class="Wizardry.WizardWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:p="clr-namespace:Wizardry.Properties"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="{Binding Title}"
        ResizeMode="NoResize"
        WindowStartupLocation="CenterOwner"
        
        Topmost="False"
        Width="750"
        Height="500">

    <!--local:DialogCloser.DialogServiceResult="{Binding Path=DialogServiceResult}"-->
    <Window.Resources>
        <Color x:Key="Color_000">#FFc7daf0</Color>
        <Color x:Key="Color_001">#FF84a0bf</Color>
        <LinearGradientBrush x:Key="BackgroundBrush" StartPoint="0.5,0" EndPoint="0.5,1">
            <GradientStop Offset="0" Color="{StaticResource Color_000}"/>
            <GradientStop Offset="1" Color="{StaticResource Color_001}"/>
        </LinearGradientBrush>

        <Color x:Key="Color_002">#FF95AECF</Color>
        <Color x:Key="Color_003">#FF577EB1</Color>
        <Color x:Key="Color_004">#FF628DC7</Color>
        <LinearGradientBrush x:Key="BreadcrumbBackgroundBrush" StartPoint="0.5,0" EndPoint="0.5,1">
            <GradientStop Offset="0" Color="{StaticResource Color_002}"/>
            <GradientStop Offset="0.7" Color="{StaticResource Color_003}"/>
            <GradientStop Offset="1" Color="{StaticResource Color_004}"/>
        </LinearGradientBrush>
    </Window.Resources>

    <Grid Background="{StaticResource BackgroundBrush}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="150"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>

        <ListBox ItemsSource="{Binding NavigationHistory}" Background="{StaticResource BreadcrumbBackgroundBrush}"
                 Grid.Column="0" Grid.Row="0">
            <ListBox.ItemContainerStyle>
                <Style TargetType="ListBoxItem">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="ListBoxItem">
                                <ContentPresenter HorizontalAlignment="Stretch" Margin="0 0 0 10"/>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </ListBox.ItemContainerStyle>
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Vertical"/>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Border x:Name="SelectionBorder" VerticalAlignment="Center" HorizontalAlignment="Center" CornerRadius="8" Padding="5">
                        <TextBlock x:Name="TitleTextBlock" Text="{Binding PageTitle}" TextWrapping="Wrap" MaxWidth="120" TextAlignment="Center"
                                   IsEnabled="{Binding IsAccessible, UpdateSourceTrigger=PropertyChanged}"/>
                    </Border>
                    <!--<ToggleButton Content="{Binding PageTitle}" VerticalAlignment="Center" HorizontalAlignment="Center"
                                  IsEnabled="{Binding IsAccessible, UpdateSourceTrigger=PropertyChanged}"
                                  IsChecked="{Binding IsSelected, UpdateSourceTrigger=PropertyChanged}"/>-->
                    <DataTemplate.Triggers>
                        <DataTrigger Binding="{Binding IsSelected}" Value="True">
                            <Setter TargetName="SelectionBorder" Property="Background" Value="#FF293955"/>
                            <Setter TargetName="TitleTextBlock" Property="Foreground" Value="White"/>
                        </DataTrigger>
                    </DataTemplate.Triggers>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        
        <ContentControl Content="{Binding CurrentPage}" Grid.Row="0" Grid.Column="1"/>

        <DockPanel LastChildFill="False" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Background="{StaticResource BackgroundBrush}">
            <Button Content="{x:Static p:Resources.Cancel}" Margin="15,5,5,5" Width="45" Command="{Binding CancelCommand}" IsCancel="True" DockPanel.Dock="Right"/>
            <Button Content="{Binding ForwardButtonText, UpdateSourceTrigger=PropertyChanged}" Margin="0,5,5,5" Width="45" Command="{Binding NextCommand}" DockPanel.Dock="Right"/>
            <Button Content="{x:Static p:Resources.Back}" Margin="5" Width="45" Command="{Binding BackCommand}" DockPanel.Dock="Right"/>
        </DockPanel>
    </Grid>
</Window>
